import Hljs from 'highlight.js'

import 'highlight.js/styles/googlecode.css'
// import 'highlight.js/styles/atom-one-dark.css'	// 样式
const Highlight = {}

Highlight.install = (Vue) => {
  Vue.directive('highlight', (el) => {
    const blocks = el.querySelectorAll('pre code')
    blocks.forEach((block) => {
      Hljs.highlightBlock(block)
    })
  })
}

export default Highlight
